﻿using System;
using System.Linq;
using System.Web;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using CSBackup_Web.Sources.Override;

namespace CSBackup_Web.Models
{
    public class NewPrjNameModel : CommonModel
    {
        private string projectName = string.Empty;
        private ProjectInfo projInfo = new ProjectInfo();
        private int activeTab = 0;

        public int ActiveTab
        {
            get { return activeTab; }
            set { activeTab = value; }
        }
        public ProjectInfo ProjInfo
        {
            set { projInfo = value; }
            get { return projInfo; }
        }

        [Required(ErrorMessage = "备份工程的名字不能为空")]
        [Display(Name = "工程名称")]
        [StringLength(16, ErrorMessage = "备份工程的名字不能超过16个字符")]
        public string ProjectName { get { return projectName; } set { projectName = value; } }

        public NewPrjNameModel()
        {
            Title = "备份工程基本信息";
            TabTitles = new List<string> { "备份工程基本信息" };
        }
    }

    public class NewPrjFileModel : CommonModel
    {
        private ProjectInfo projInfo = new ProjectInfo();
        private List<string> fileList = new List<string>();
        private List<bool> fileListValue = new List<bool>();
        private string projectName = string.Empty;
        private int activeTab = 0;

        public int ActiveTab
        {
            get { return activeTab; }
            set { activeTab = value; }
        }
        public string ProjectName
        {
            set { projectName = value; }
            get { return projectName; }
        }
        public List<bool> FileListValue
        {
            set { fileListValue = value; }
            get { return fileListValue; }
        }
        public List<string> FileList
        {
            set { fileList = value; }
            get { return fileList; }
        }
        public ProjectInfo ProjInfo
        {
            set { projInfo = value; }
            get { return projInfo; }
        }

        public NewPrjFileModel()
        {
            Title = "备份工程文件选择";
            TabTitles = new List<string> { "备份工程文件选择" };
        }
    }

    public class ChoosePrjModel : CommonModel
    {
        public ChoosePrjModel()
        {
            Title = "选择工程";
            TabTitles = new List<string> { "选择工程" };
        }
        private string chosenPrjName;
        private List<string> prjNames = new List<string>();
        private ProjectInfo projInfo = new ProjectInfo();
        private int activeTab = 0;
        public int ActiveTab
        {
            set { activeTab = value; }
            get { return activeTab; }
        }
        public string ChosenPrjName
        {
            set { chosenPrjName = value; }
            get { return chosenPrjName; }
        }
        public List<string> PrjNames
        {
            set { prjNames = value; }
            get { return prjNames; }
        }
        public ProjectInfo ProjInfo
        {
            set { projInfo = value; }
            get { return projInfo; }
        }
    }

    public class AutoBkpModel : CommonModel
    {
        public AutoBkpModel()
        {
            Title = "自动备份";
            TabTitles = new List<string> { "自动备份" };
        }
        private string method;
        private string taskName;
        private ProjectInfo projInfo = new ProjectInfo();
        private string stringDate;
        private int hour;
        private int minute;
        private string intervalUnit;
        private int intervalValue;
        private string cycle;
        private int homeTab = 0;
        public int ActiveTab
        {
            set { homeTab = value; }
            get { return homeTab; }
        }
        public int IntervalValue
        {
            set { intervalValue = value; }
            get { return intervalValue; }
        }
        public string Cycle
        {
            set { cycle = value; }
            get { return cycle; }
        }
        public string IntervalUnit
        {
            set { intervalUnit = value; }
            get { return intervalUnit; }
        }
        public int Hour
        {
            get { return hour; }
            set { hour = value; }
        }
        public int Minute
        {
            get { return minute; }
            set { minute = value; }
        }
        public string StringDate
        {
            get { return stringDate; }
            set { stringDate = value; }
        }
        public string Method
        {
            get { return method; }
            set { method = value; }
        }
        public string TaskName
        {
            get { return taskName; }
            set { taskName = value; }
        }
        public ProjectInfo ProjInfo
        {
            get { return projInfo; }
            set { projInfo = value; }
        }
    }

    public class BkpSvcModel : CommonModel
    {
        public BkpSvcModel()
        {
            Title = "自动备份";
            TabTitles = new List<string> { "自动备份" };
        }
        private List<List<string>> items = new List<List<string>>();
        private List<bool> itemCheck = new List<bool>();
        public List<bool> ItemCheck
        {
            get { return itemCheck; }
            set { itemCheck = value; }
        }
        public List<List<string>> Items
        {
            get { return items; }
            set { items = value; }
        }
    }

    public class PrtRcvrModel : CommonModel
    {
        public PrtRcvrModel()
        {
            Title = "恢复部分文件";
            TabTitles = new List<string> { "恢复部分文件" };
        }
        private List<List<string>> fileInfo = new List<List<string>>();
        private List<bool> fileInfoValue = new List<bool>();
        private ProjectInfo projInfo = new ProjectInfo();
        public ProjectInfo ProjInfo
        {
            set { projInfo = value; }
            get { return projInfo; }
        }
        public List<List<string>> FileInfo
        {
            set { fileInfo = value; }
            get { return fileInfo; }
        }
        public List<bool> FileInfoValue
        {
            set { fileInfoValue = value; }
            get { return fileInfoValue; }
        }
    }
}